module.exports = {
  sellIfReversePreTrend () {
    if (
      this.tradeTime15mCycle === 4 &&
      this.analysisInfo15m.kdjDiff < 0 &&
      this.analysisInfo15m.isMacdDecline &&
      this.analysisInfo15m.ema5W10A20Days >= 48 &&
      this.analysisInfo1h.ema5W10A20Days >= 32 &&
      this.analysisInfo1h.netChangeRatioList[0] >= 10 &&
      this.analysisInfo1h.netChangeRatioList[1] >= 10
    ) {
      this.setSellByPreReverse('sellIfPreReverseTrend-0001', {
        level: 0,
        rate: 1
      })
    }
    if (
      this.analysisInfo15m.macd < 0 &&
      this.analysisInfo15m.kdjDownDays >= 6 &&
      this.analysisInfo15m.ema5A10A20Days >= 20 &&
      this.analysisInfo1h.kdjDiff > 0 &&
      this.analysisInfo1h.macdUpDays <= 5
    ) {
      this.setSellByPreReverse('sellIfPreReverseTrend-0002', {
        level: 0,
        rate: 0.5
      })
    }
    if (
      this.tradeTime15mCycle === 4 &&
      this.analysisInfo15m.macd < 0 &&
      this.analysisInfo15m.kdjDownDays >= 6 &&
      this.analysisInfo15m.ema5A10A20Days >= 20 &&
      this.analysisInfo1h.kdjDiff > 0 &&
      this.analysisInfo1h.isKdjDecline &&
      this.analysisInfo1h.macdUpDays <= 5 &&
      this.analysisInfo1h.ema5A20Days <= 2
    ) {
      this.setSellByPreReverse('sellIfPreReverseTrend-0003', {
        level: 0,
        rate: 1
      })
    }
    if (
      this.analysisInfo1h.netChangeRatioList[0] >= 30 &&
      this.analysisInfo1h.netChangeRatioList[1] >= 30 &&
      this.analysisInfo15m.netChangeRatioList[0] >= 15 &&
      this.analysisInfo15m.netChangeRatioList[1] >= 12 &&
      this.btbItem.price_change_percent < 150
    ) {
      this.setSellByPreReverse('sellIfPreReverseTrend-0004', {
        level: 0,
        rate: 1
      })
    }
    if (
      this.tradeTime15mCycle === 4 &&
      this.analysisInfo15m.macdUpDays === 1 &&
      this.analysisInfo15m.kdjUpDays === 1 &&
      this.analysisInfo15m.ema5A10A20Days === 1 &&
      this.analysisInfo15m.ema5W10A20Days === 1 &&
      this.analysisInfo1h.kdjUpDays === 1
    ) {
      this.setSellByPreReverse('sellIfPreReverseTrend-0005', {
        level: 0,
        rate: 1
      })
    }
    if (
      this.analysisInfo15m.ema5A10A20Days >= 1 &&
      this.analysisInfo15m.ema5W10A20Days <= 4 &&
      this.analysisInfo15m.isKdjDecline &&
      this.analysisInfo15m.kdjUpDays <= 11 &&
      this.analysisInfo1h.kdjDownDays >= 6 &&
      (
        this.analysisInfo1h.ema5B10Days >= 1 ||
        this.analysisInfo1h.isMacdDecline
      )
    ) {
      // this.setSellByPreReverse('sellIfPreReverseTrend-0006', {
      //   level: 0,
      //   rate: 1
      // })
    }
    if (
      this.analysisInfo15m.lastKdjUpDays >= 15 &&
      this.analysisInfo15m.kdjDownDays >= 7 &&
      this.analysisInfo15m.isKdjDecline &&
      this.analysisInfo15m.isMacdDecline &&
      this.analysisInfo15m.ema5W10A20Days >= 20 &&
      this.analysisInfo15m.ema5A10A20Days >= 7 &&
      [1, 4].indexOf(this.tradeTime15mCycle) !== -1
    ) {
      this.setSellByPreReverse('sellIfPreReverseTrend-0007', {
        level: 0,
        rate: 1
      })
    }
  }
}
